/**
 * Created by mapbar_front on 2019/8/12.
 */
import React,{Component} from 'react';
import PropTypes from 'prop-types';


class Greeting extends Component{
    render(){
        return(
            <div>
                Greeting,{this.props.name}
            </div>
        )
    }
}
Greeting.propTypes = {
    name: PropTypes.string,
}


class PropT extends Component{
    static defaultProps = {
        name: 'stranger'
    }
    constructor(props){
        super(props);
    }
    render(){
        return (
            <div>
                {this.props.children},
                {this.props.name}
            </div>
        )
    }
}
PropT.propTypes = {
    children: PropTypes.element.isRequired
}
// PropT.defaultProps = {
//     name: 'xiaoxioa',
// }
export default PropT;